import Swiper from '../../../libs/swiper/swiper-bundle.min.mjs'

let mySwiper = new Swiper('.swiper', {
  direction: 'horizontal', // 垂直切换选项
  loop: true, // 循环模式选项
  // 自动切换
  autoplay: {
    delay: 2000, // 自动切换时间间隔
    pauseOnMouseEnter: true, // 鼠标进入swiper时，停止自动切换
    disableOnInteraction: false, // 用户操作swiper之后自动切换不会停止
  },
  // 如果需要分页器
  pagination: {
    el: '.swiper-pagination',
    clickable: true,
  },
  // 淡入淡出
  effect: 'fade',
  // 如果需要前进后退按钮
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },

  // 如果需要滚动条
  scrollbar: {
    el: '.swiper-scrollbar',
  },

})
for (let i = 0; i < mySwiper.pagination.bullets.length; i++) {
  mySwiper.pagination.bullets[i].onmouseover = function () {
    this.click()
  }
}
export default mySwiper